package com.enjoylearning.auth.controller;

import com.enjoylearning.auth.service.FindPasswordService;
import com.enjoylearning.base.model.RestResponse;
import com.enjoylearning.ucenter.model.dto.FindPasswordParamDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
public class FindPasswordController {

    @Autowired
    FindPasswordService findPasswordService;

    @ApiOperation("找回密码")
    @ResponseBody
    @PostMapping("/findpassword")
    public RestResponse findPassword(@RequestBody FindPasswordParamDto findPasswordParamDto) {
        return findPasswordService.setNewPassword(findPasswordParamDto);
    }

    @RequestMapping("/success")
    public String success() {
        return "redirect:http://www.51xuecheng.cn:90/sign.html";
    }
}
